//
//  HomePageViewCell.m
//  YiqiMobile
//
//  Created by henry on 13-3-23.
//  Copyright (c) 2013年 henry. All rights reserved.
//

#import "HomePageViewCell.h"
#import "Utility.h"
#import "Config.h"

@implementation HomePageViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
    // Initialization code
        self.selectionStyle=UITableViewCellSelectionStyleNone;
        self.backgroundColor = [UIColor clearColor];
        UIImageView *bg=[[UIImageView alloc] initWithFrame:self.frame];
        bg.image=[UIImage imageNamed:@"homepageCellbg1.png"];
        self.backgroundView=bg;
        //是否阅读过
        self.startImageView=[[UIImageView alloc] initWithFrame:CGRectMake(8, 24, 6, 6)];
         self.startImageView.image=[Utility imageNamed:@"homepagecellstar.png"];
        [self addSubview:self.startImageView];
        
         //是否是文集
        self.iConImageView=[[UIImageView alloc] initWithFrame:CGRectMake(240, 15, 25, 19)];
        self.iConImageView.hidden=YES;
        self.iConImageView.image=[Utility imageNamed:@"homepageCellwenji.png"];
        [self addSubview:self.iConImageView];
        
        self.content=[Utility detailTextLabel:CGRectMake(20, 16, 240, 20) andFontSize:15.0f];
        self.content.textColor=UIColorFromRGB(0x555555);

        [self addSubview:self.content];
        
        UIImageView *arrowImageView=[[UIImageView alloc] initWithFrame:CGRectMake(280, 21, 19, 19)];
        arrowImageView.image=[Utility imageNamed:@"homepageCellarrow.png"];
        [self addSubview:arrowImageView];
        
  //详细内容
        
        self.detailTitle1=[Utility detailTextLabel:CGRectMake(8, 40, 225, 20) andFontSize:9.0f];
        self.detailTitle1.textColor=UIColorFromRGB(0x666666);
       
        [self addSubview:self.detailTitle1];
    //日期   
        self.detailTitle2=[Utility detailTextLabel:CGRectMake(240, 40, 65, 20) andFontSize:9.0f];
        self.detailTitle2.textAlignment=NSTextAlignmentRight;
        self.detailTitle2.textColor=UIColorFromRGB(0x666666);
        [self addSubview:self.detailTitle2];
        
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated{
    [super setSelected:selected animated:animated];
    if (selected) {
        UIImageView *bg=[[UIImageView alloc] initWithFrame:self.frame];
        bg.image=[Utility imageNamed:@"homepageCellbg2.png"];
        self.backgroundView=bg;
    }else{
       
        UIImageView *bg=[[UIImageView alloc] initWithFrame:self.frame];
        bg.image=[Utility imageNamed:@"homepageCellbg1.png"];
        self.backgroundView=bg;
    }
   
    // Configure the view for the selected state
}

@end
